<template>
  <div class="Head-container">
    <div class="left">
      <img src="../assets/img/heima.png" alt="" />
      <span>电商后台管理系统</span>
    </div>
    <div>
      <el-button @click="backlogin">退出</el-button>
    </div>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  methods: {
    ...mapMutations(['clearform']),
    backlogin() {
      sessionStorage.clear('token')
      this.$router.push('/login')
      this.clearform()
    }
  }
}
</script>

<style lang="less" scoped>
.Head-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    display: flex;
    align-items: center;
    span {
      color: white;
      font-size: 20px;
      margin-left: 20px;
    }
    img {
      width: 60px;
      height: 60px;
      object-fit: contain;
    }
  }
}
</style>
